package snafu.framework.senses.perceptions;

import snafu.framework.senses.stimuli.Stimulus;
import snafu.framework.view.Access;
import snafu.framework.view.ViewFactory;
import snafu.utility.Interval;

public class PerceptionItself implements ViewFactory<PerceptionView>, Perception{

	protected Class<? extends Stimulus> stimulus;
	protected Interval strength;
	
	public PerceptionItself(Class<? extends Stimulus> stimulus, Interval strength) {
		this.stimulus = stimulus;
		this.strength = strength;
	}
	
	public PerceptionItself(Class<? extends Stimulus> stimulus, int minStrength, int maxStrength) {
		this(stimulus, new Interval(minStrength, maxStrength));
	}
	
	@Override
	public Class<? extends Stimulus> getStimulus() {
		return stimulus;
	}

	@Override
	public Interval getStrength() {
		return strength;
	}

	@Override
	public PerceptionView createView(Access access) {
		return new PerceptionView(access, this);
	}

}
